<?php
	$id_news = $this->uri->segment(4,0);
//	echo $id_images;
	$this->load->database();
	//$query = $this->db->query("select images_small from news where id_news='$id_news'");
	
	foreach($query->result() as $row):
	$im = imagecreatefromstring($row->images_small);
	
	if ($im !== "") {
	    header('Content-Type: image/jpeg');
	    imagejpeg($im);
	    imagedestroy($im);
	//    header('Content-Type: image/bmp');
	//    imagebmp($im);
	//    imagebmp($im);
	} else {
	    echo "<img src='site_url('images/nopicture.jpg')' />";
	//	echo "error";
	}
	//echo "asjkdalksd";
	
	endforeach;
?>